/*
 * ImageResultReceiver.java
 * classes : com.ruint.lib.mediachooser.receiver.ImageResultReceiver
 * @author ruint
 * V 1.0.0
 * Create at 2014-12-4 下午3:34:44
 */
package com.ruint.lib.mediachooser.receiver;

import java.util.List;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.ruint.core.adapter.BaseListAdapter;
import com.ruint.lib.mediachooser.core.MediaChooserConstants;

/**
 * com.ruint.lib.mediachooser.receiver.ImageResultReceiver
 * 
 * @author ruint <br/>
 *         create at 2014-12-4 下午3:34:44
 * @param <T>
 */
public class ImageResultReceiver<T extends BaseListAdapter<String>> extends BroadcastReceiver {

  private T mAdapter;

  public ImageResultReceiver(T adaper) {
    this.mAdapter = adaper;
  }

  @Override
  public void onReceive(Context context, Intent intent) {
    mAdapter.refresh((List<String>) intent.getStringArrayListExtra(MediaChooserConstants.MEDIA_SELECTED_LIST));
  }

}
